<template>
	<van-card v-for="item,index in data" 
		:key="index" 
		:thumb="item.imgUrl" 
		>
		<template #title>
			<router-link class="detail" :to="{'name':'details',
			   'params':{'id':item.id}}">
				{{item.title}}<br/>
			</router-link>
		</template>
		<template #desc>
		  <span style="color: gray;">{{item.desc}}</span><br/>
		</template>
		
		<template #tags>
			<van-tag plain color=#FFB5C5>{{item.tag}}</van-tag>
		</template>
		<template #footer>
			<van-button size="mini" icon="good-job-o"></van-button>
			<van-button size="mini" icon="star-o" to="/login"></van-button>
			<van-button size="mini" icon="comment-o" to="/login"></van-button>
		</template>
	</van-card>
	
</template>

<script lang="ts" setup>

	const props = defineProps({
		// 父组件传过来的数据
		data: Array
	})

</script>

<style>
</style>